/*
 * @Author: hxt_caizhengxiang Czx12211001
 * @Date: 2025-04-25 13:44:39
 * @LastEditors: hxt_caizhengxiang Czx12211001
 * @LastEditTime: 2025-04-25 13:59:49
 * @FilePath: \Code\User_App\u_Beep.c
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "u_Beep.h"
#include "bsp_PWM.h"

PWM_t BEEP;

/** @brief  蜂鸣器初始化
 *  @return 无
 *  @property 无
 */
void Beep_Init(void)
{
    BEEP = bsp_PWM_Obj_New(BEEP_IN1_GPIO, 2000, 50, p_STOP);
}

/** @brief  函数名称
 *  @param  value (蜂鸣次数)
 *  @return 无
 *  @property 无
 */
void Beep_Sound(uint8_t value)
{
    for (uint8_t i = 0; i < value; i++)
    {
        bsp_PWM_Set_Run(&BEEP);
        LL_mDelay(50);
        bsp_PWM_Set_Stop(&BEEP);
        LL_mDelay(50);
    }
}
